<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>基于ESP32S3的实验室门禁系统设计与实现-登录</title>
    {% load static %}
    <style>
        body {
            font-family: 'Segoe UI', system-ui;
            background-image: url("{% static 'images/ChatGPT_Image.png' %}");
            background-size: cover;;
            background-position: center;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            position: relative;
            overflow: hidden;
        }
        
        .login-container {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
            transform: translateY(0);
            transition: all 0.3s ease;
            position: relative;
            z-index: 1;
        }
        .login-container h1 {
            margin-top: 0;
        }
        .login-container label {
            display: block;
            margin: 10px 0 5px;
        }
        .login-container input[type="text"],
        .login-container input[type="password"] {
            width: 100%;
            padding: 10px;
            margin-bottom: 10px;
            border: 1px solid #ccc;
            border-radius: 5px;
        }
        .login-container input[type="submit"] {
            width: 100%;
            padding: 10px;
            background-color:rgb(9, 129, 221);
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .login-container input[type="submit"]:hover {
            background-color:hsl(349, 66.20%, 53.50%);
        }
    </style>
</head>
<body>
    <div>
    <div class="login-container">
        <h1>登录</h1>
        <form method="post">
            {% csrf_token %}
            <label for="username">用户名:</label>
            <input type="text" id="username" name="username" required>
            <label for="password">密码:</label>
            <input type="password" id="password" name="password" required>
            <input type="submit" value="Login">
        </form>
        <p class="register-link">还没有账户？<a href="{% url 'register' %}">注册一个</a></p>
    </div>
    </div>
</body>
<script>
    // 动态背景粒子
    document.addEventListener('DOMContentLoaded', function() {
        const canvas = document.createElement('canvas');
        const ctx = canvas.getContext('2d');
        canvas.style.position = 'absolute';
        canvas.style.top = 0;
        canvas.style.left = 0;
        canvas.style.zIndex = 0;
        document.body.appendChild(canvas);

        function resize() {
            canvas.width = window.innerWidth;
            canvas.height = window.innerHeight;
        }
        window.addEventListener('resize', resize);
        resize();

        // 粒子动画逻辑...
    });
</script>
</html>
